import React from 'react'
import '../../../assets/css/home/menuRight/userInfo.sass'
import { useSelector } from 'react-redux'

export default function UserInfo() {
    const state = useSelector(state => state)
    const userInfo = state.menuNav.userInfo ? state.menuNav.userInfo[0] : {}
    return (
        <div className='userInfo'>
            <header>
                <span>账户信息</span>
                <span style={{ color: '#1890ff', cursor: 'pointer' }}>账户设置</span>
            </header>
            <main>
                <ul>
                    <li><span>&nbsp;用 户 名 ：</span>{userInfo.admin}</li>
                    <li><span>所在部门：</span>{userInfo.dept}</li>
                    <li><span>本次登录：</span>{userInfo.nowTime}</li>
                    <li><span>登录地区：</span>{'四川省成都市 (IP：' + userInfo.ip + ')'}</li>
                    <li><span>上次登录：</span>{userInfo.lastTime}</li>
                </ul>
            </main>
        </div>
    )
}
